﻿/*
   Author: Tomer Paz
   games.com
   2009
*/

/* Game Info container (Viewer) */

package monopoly.views {
	import flash.display.Sprite;
	import flash.display.DisplayObjectContainer;
	import flash.display.DisplayObject;
	import fl.containers.ScrollPane;
	import flash.display.Stage;
	import monopoly.IFS.GLOBALS;
	import monopoly.views.TitlePane;
	import monopoly.Localization.*;

	public class GameInfoViewer extends ScrollPane
		{
		protected var _Title:TitlePane;
		
		public function GameInfoViewer()
			{
			var myString:ILocalLanguage = LocalLanguage.getInstance();
			setupTitle(myString.GameInfo);
			}
		public override function set width(value:Number):void
			{
			_Title.width = value -1;
			super.width  = value;
			}

		public override function addChild(value:DisplayObject):DisplayObject
			{
			value.x = GLOBALS.HPADDING;
			value.y = GLOBALS.DEFAULT_TITLE_HEIGHT + GLOBALS.VPADDING;
			value.width = this.width - GLOBALS.HPADDING;
			value.height= this.height- GLOBALS.VPADDING - GLOBALS.DEFAULT_TITLE_HEIGHT - 3;
			super.addChild(value);
			
			return value;
			}
		
		protected function setupTitle(Title:String):void
			{
			_Title = new TitlePane(Title);
			_Title.x = 1;
			_Title.y = 3;
			
			super.addChild(_Title);
			}
		}
}
